package com.hongshan.wallet.core.home

import android.arch.lifecycle.ViewModelProviders
import android.databinding.ViewDataBinding
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.hongshan.wallet.BR
import com.hongshan.wallet.Constant
import com.hongshan.wallet.R
import com.hongshan.wallet.base.MyActivity
import com.hongshan.wallet.bean.TradingAlertBean
import com.hongshan.wallet.router.RouterIndex
import kotlinx.android.synthetic.main.appbar.*

/**
 * Copyright Zhangxx.
 * Copyright (c) 2019
 * All rights reserved
 *
 * @project  : Wallet
 * @package  : com.example.wallet.core.trading
 * @author   : zhangxx
 * @date     : 2019/3/28
 * @email    : qq957413212@hotmail.com
 * @desc     : //TODO
 */
@Route(path = RouterIndex.TRADING_ALERT)
class TradingAlertActivity: MyActivity<ViewDataBinding, TradingAlertViewModel>() {

//    @Autowired
    var tradingAlert:TradingAlertBean? = null

    override fun initVariableId() = BR.vm

    override fun initContentView(savedInstanceState: Bundle?) = R.layout.activity_trading_alert

    override fun initViewModel(): TradingAlertViewModel = ViewModelProviders.of(this)[TradingAlertViewModel::class.java]

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
//        ARouter.getInstance().inject(this)
        tvTitle.text = "交易提醒"
        tradingAlert = Constant.gson.fromJson(intent.getStringExtra(Constant.ROUTE_PARAMS_KEY.TRADING_ALERT),TradingAlertBean::class.java)
        tradingAlert?.let { viewModel.setItemInfo(it) }
    }
}